package com.df.my_net_game.proto.equip;


import java.io.Serializable;

import com.baidu.bjf.remoting.protobuf.*;

import com.baidu.bjf.remoting.protobuf.utils.*;

import com.google.protobuf.*;

import java.io.IOException;

import com.baidu.bjf.remoting.protobuf.code.*;


public class C2G_EquipUpLevel$$JProtoBufClass2 implements com.baidu.bjf.remoting.protobuf.Codec<com.df.my_net_game.proto.equip.C2G_EquipUpLevel>, Serializable {
    public static final long serialVersionUID = 1L;
    private com.google.protobuf.Descriptors.Descriptor descriptor;

    public byte[] encode(com.df.my_net_game.proto.equip.C2G_EquipUpLevel t) throws IOException {
        CodecOutputByteArray output = CodecOutputByteArray.get();
        doWriteTo(t, output.getCodedOutputStream());
        return output.getData();
    }

    public com.df.my_net_game.proto.equip.C2G_EquipUpLevel decode(byte[] bb) throws IOException {
        CodedInputStream input = CodedInputStream.newInstance(bb, 0, bb.length);
        return readFrom(input);
    }

    public int size(com.df.my_net_game.proto.equip.C2G_EquipUpLevel t) throws IOException {
        int size = 0;

        Integer f_1 = null;
        if (!CodedConstant.isNull((Integer) FieldUtils.getField(t, "level"))) {
            f_1 = (Integer) FieldUtils.getField(t, "level");
            size += com.google.protobuf.CodedOutputStream.computeInt32Size(1,f_1.intValue());

        }


        return size;
    }

    public void doWriteTo(com.df.my_net_game.proto.equip.C2G_EquipUpLevel t, CodedOutputStream output)
            throws IOException {

        Integer f_1 = null;
        if (!CodedConstant.isNull((Integer) FieldUtils.getField(t, "level"))) {
            f_1 = (Integer) FieldUtils.getField(t, "level");
            if (f_1 != null){
                output.writeInt32(1, f_1.intValue());
            }

        }

    }

    public void writeTo(com.df.my_net_game.proto.equip.C2G_EquipUpLevel t, CodedOutputStream output)
            throws IOException {
        doWriteTo(t, output);
    }

    public com.df.my_net_game.proto.equip.C2G_EquipUpLevel readFrom(CodedInputStream input) throws IOException {
        com.df.my_net_game.proto.equip.C2G_EquipUpLevel ret = new com.df.my_net_game.proto.equip.C2G_EquipUpLevel();




        try {
            boolean done = false;
            Codec codec = null;
            while (!done) {
                int tag = input.readTag();
                if (tag == 0) {
                    break;
                }

                if (tag == 8) {

                    FieldUtils.setField(ret, "level", input.readInt32())
                    ;



                    continue;
                }



                input.skipField(tag);
            }
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
            throw e;
        } catch (java.io.IOException e) {
            throw e;
        }

        return ret;

    }


    public com.google.protobuf.Descriptors.Descriptor getDescriptor() throws IOException {
        if (this.descriptor != null) {
            return this.descriptor;
        }
        com.google.protobuf.Descriptors.Descriptor descriptor =
                CodedConstant.getDescriptor(com.df.my_net_game.proto.equip.C2G_EquipUpLevel.class);
        return (this.descriptor = descriptor);
    }
}


